package com.yikome.order.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.order.entity.Order;

@Repository
public interface OrderRepository extends CommonRepository<Order, Long> {

	@Query("select t from Order t where t.yn = 1 and t.id = :id")
	Order findOrder(@Param("id")Long id);

	@Query("select t from Order t where t.yn = 1 and t.code = :orderCode")
	Order findOrder(@Param("orderCode")String orderCode);
	
	long deleteByCode(String orderCode);

}
